﻿
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;

namespace WpfSnqkGasAnalysis
{
    /// <summary>
    /// 步骤值，颜色控制
    /// </summary>
    /// 创建时间：2023-1-17 16:56:21。作者：王浩力
    class StepBackgroundColorConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {

            Style cellStyle = new Style(typeof(DataGridCell));
            if (parameter != null && parameter.ToString() == "4")
            {
                cellStyle.Setters.Add(new Setter(DataGridCell.BackgroundProperty, Brushes.LightGreen));
            }

            return cellStyle;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
